﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using ChineseSchool.BLL;
using ChineseSchool.Models.Hethong;

namespace ChineseSchool
{
    public partial class Activities : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                lblActivities.Text = LoadActivitiesContent();
            }
        }

        public string LoadActivitiesContent()
        {
            string strActivities = "";
            List<M_Activities> lstActivities = new B_Activities().GetAlls(0);
            if (lstActivities != null && lstActivities.Count > 0)
            {
                for (int i = 0; i < lstActivities.Count; i++)
                {
                    strActivities += "<span class=\"span_text_1\">Ngày " + lstActivities[i].ActivitiesDate.ToString("dd/MM/yyyy") + ": ";
                    strActivities += "<a href=\"" + Util.MakeLinkActivitiesDetail(lstActivities[i].ActivitiesID.ToString(), Encode.Uni2KD(lstActivities[i].ActivitiesTitle.ToString())) + "\">" + lstActivities[i].ActivitiesTitle.ToString() + "</a></span>";
                }
            }
            return strActivities;
        }
    }
}